<div class="bjui-pageHeader">
    <div class="pull-right">
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
</div>
<div class="bjui-pageContent">
    <form action="{:U('save_wmk')}" data-toggle="validate" data-alertmsg="false" class="navtabForm">
        <div class="form-group">
            <label class="x100">商品图片加水印:</label>
            <input type="radio" name="wmk_status" value="0" id="wmk-add1" data-toggle="icheck" data-label="开启" <if condition="$va.wmk_status eq '0' or $va.wmk_status eq null"> checked</if>/>
            <input type="radio" name="wmk_status" value="1" id="wmk-add2" data-toggle="icheck" data-label="关闭" <if condition="$va.wmk_status eq '1'"> checked</if>  />
        </div>
        <div class="form-group select-wmk-type">
            <label class="x100">水印类型:</label>
            <input type="radio" name="wmk_type" id="wmk-type1" value="1" data-toggle="icheck" data-label="文字"   <if condition="$va.wmk_type eq '1'"> checked</if> />
            <input type="radio" name="wmk_type" id="wmk-type2" value="2" data-toggle="icheck" data-label="图片" <if condition="$va.wmk_type neq '1'"> checked </if> />
        </div>
        <div class="form-group clearfix type-image" <if condition="$va.wmk_type eq '1'">style="display: none;" </if>>
            <label class="x100 pull-left">水印图片:</label>
            <div class="pull-left parent_img">
            <if condition="$va.wmk_photo eq null">
                <img src="__PU__/images/58008889b30bc.jpg" alt="LOGO" width="70" />
            <else/>
                 <img src="{$va.wmk_photo}" alt="LOGO" width="70" />
            </if>
                <input type="hidden" name="wmk_photo" value="{$va.wmk_photo}"/>
                <span data-toggle="upload"
                      data-uploader="{:U('Index/upload')}"
                      data-file-type-exts="*.png;*.jpg"
                      data-icon="cloud-upload"
                      data-on-upload-success="upload_callback"
                      data-auto="true"
                      data-button-text="上传图片"
                ></span>
            </div>
        </div>
        <div class="form-group type-wrt" <if condition="$va.wmk_type neq '1'">style="display: none;"</if>>
            <label class="x100">水印文字:</label>
            <input type="text" name="wmk_text"  value="{$va.wmk_text}"/>
        </div>
        <!-- <div class="form-group">
       <label class="x100">水印大小:</label>
            宽:<input type="text" name="" value="100" data-rule="required" class="w100" />
            高:<input type="text" name="" value="100" data-rule="required" class="w100" />
            <span class="text-warning">单位:象素(px)</span>
        </div> -->
        <div class="form-group">
            <label class="x100">水印透明度:</label>
            <input type="text" name="wmk_alpha" class="w60" value="{$va['wmk_alpha']?$va['wmk_alpha']:'80'}" data-toggle="spinner" data-min="0" data-max="100" data-step="1" data-rule="integer" />
            <span class="text-warning">0代表完全透明，100代表不透明</span>
        </div>
       <!--  <div class="form-group">
            <label class="x100">水印质量:</label>
            <input type="text" name="mass" class="w60" value="50" data-toggle="spinner" data-min="0" data-max="100" data-step="1" data-rule="integer" />
            <span class="text-warning">设置为0-100之间的数字,决定 jpg 格式图片的质量</span>
        </div> -->
        <div class="form-group clearfix">
            <label class="x100 pull-left text-top">水印位置:</label>
            <div class="pull-left">
                <p>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="左上角"   value="1" <if condition="$va.wmk_seat eq '1' or $va.wmk_seat eq null">checked</if>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="上居中"   value="2" <if condition="$va.wmk_seat eq '2'">checked</if>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="右上角"   value="3" <if condition="$va.wmk_seat eq '3'">checked</if>/>
                </p>
                <p>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="左居中"   value="4" <if condition="$va.wmk_seat eq '4'">checked</if>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="中心点" value="5"  <if condition="$va.wmk_seat eq '5'">checked</if>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="右居中"  value="6" <if condition="$va.wmk_seat eq '6'">checked</if>/>
                </p>
                <p>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="左下角"  value="7" <if condition="$va.wmk_seat eq '7'">checked</if>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="下居中"  value="8" <if condition="$va.wmk_seat eq '8'">checked</if>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="右下角"  value="9" <if condition="$va.wmk_seat eq '9'">checked</if>/>
                </p>

            </div>
        </div>
    </form>
</div>
<script>
    $(function () {
        $('input[name="wmk_type"]').on('ifChanged', function (e) {
            var checked = $(this).is(':checked'),
                    val = $(this).val();
            if( checked ){
                if( val == 1 ){
                    $('.type-wrt').show();
                    $('.type-image').hide();
                }else {
                    $('.type-wrt').hide();
                    $('.type-image').show();
                }
            }
        });
    });
</script>
<include file="Common/footer" ftype="save"/>